import request from '@/utils/request'
// GET /admin/product/getCategory1  获取一级分类
export const reqCategory1List = () => request({
    url: "/list-api/admin/product/getCategory1",
    method: 'get'
})
// GET /admin/product/getCategory2/{category1Id} 获取二级分类
export const reqCategory2List = (category1Id) => request({
    url: `/list-api/admin/product/getCategory2/${category1Id}`,
    method: 'get'
})
// GET /admin/product/getCategory3/{category2Id} 获取三级分类
export const reqCategory3List = (category2Id) => request({
    url: `/list-api/admin/product/getCategory3/${category2Id}`,
    method: 'get'
})
// GET /admin/product/attrInfoList/{category1Id}/{category2Id}/{category3Id} 根据分类id获取商品属性
export const reqAttrInfoList = ({ category1Id, category2Id, category3Id }) => request({
    url: `/list-api/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`,
    method: 'get'
})
// POST /admin/product/saveAttrInfo  添加属性信息
export const reqSaveAttrInfo = (data) => request({
    url: `/list-api/admin/product/saveAttrInfo`,
    method: 'POST',
    data
})
// DELETE /admin/product/deleteAttr/{attrId}  删除属性
export const reqDeleteAttr = (attrId) => request({
    url: `/list-api/admin/product/deleteAttr/${attrId}`,
    method: 'DELETE'
})